package com.java.yz.day04.homework;

/*
    数组查找法（根据键盘录入索引，查找对应星期）
 */
import java.util.Scanner;
public class ArrayText4 {
    public static void main(String[] args) {
        String[] arr1={"星期一","星期二","星期三","星期四","星期五","星期六","星期天",};
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字（只限1-7）");
        int num=sc.nextInt();
        if (num>0 && num<=7) {
            System.out.println("今天是：" + arr1[num-1]);
        }
        else {
            System.out.println("你输入的数字有异常");
        }
    }
}
